package com.jxc.model.po;

/***********************************************************************
 * Module:  Salelist.java
 * Author:  Administrator
 * Purpose: Defines the Class Salelist
 ***********************************************************************/

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 销售单
 * 
 * @pdOid 15c92f65-d4c2-481e-8625-b3284fb4e2dd
 */
@Entity
@Table(name = "XSGL_SALELIST")
public class Salelist extends IdEntity implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2307302108319426192L;
	/**
	 * 日期
	 * 
	 * @pdOid 2b2337e8-eef9-457c-9b8f-39fb31628160
	 */
	private Date date;
	/**
	 * 单号
	 * 
	 */
	private String serial;
	/**
	 * 营业员
	 * 
	 * @pdOid 7af5a759-787b-47ab-bb7b-8cc4b13b6fe6
	 */
	private User user;
	/**
	 * 会员
	 * 
	 * @pdOid 803292e8-4fee-46ba-a302-76c1c9b7faf0
	 */
	private Member member;
	/**
	 * 出货仓库
	 * 
	 * @pdOid 9e7ed2ec-8dc2-43de-ba7f-b1eeeb199669
	 */
	private Repertory repertory;
	/**
	 * 销售总额
	 * 
	 * @pdOid d4c7519f-b55e-4f2f-a3c1-41a4d52a4fe4
	 */
	private Double total;
	/**
	 * 实付金额
	 * 
	 */
	private Double realPay;
	/**
	 * 抹零金额
	 */
	private Double wipeZero;
	/**
	 * 找零金额
	 */
	private Double charge;
	/**
	 * 使用积分数
	 */
	private Integer pointNum;
	/**
	 * 备注
	 * 
	 * @pdOid 43d6557b-67b7-469c-a253-74e9e097b082
	 */
	private String remark;

	/**
	 * 销售明细
	 */
	private List<SalelistItem> items = new ArrayList<SalelistItem>();

	private List<SaleReturnlist> salereturnlists;
	
	
	/*
	 * 优惠金额
	 */
	private Double viptotal;
	
	@Column(name = "VIPTOTAL")
	public Double getViptotal() {
		return viptotal;
	}

	public void setViptotal(Double viptotal) {
		this.viptotal = viptotal;
	}

	

	public Salelist() {
		super();
	}
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "saleList")
	public List<SaleReturnlist> getSalereturnlists() {
		return salereturnlists;
	}

	public void setSalereturnlists(List<SaleReturnlist> salereturnlists) {
		this.salereturnlists = salereturnlists;
	}

	public Salelist(Long id) {
		super(id);
	}

	@Column(name = "SERIAL")
	public String getSerial() {
		return serial;
	}

	public void setSerial(String serial) {
		this.serial = serial;
	}

	@Column(name = "REAL_PAY", length = 10, precision = 2)
	public Double getRealPay() {
		return realPay;
	}

	public void setRealPay(Double realPay) {
		this.realPay = realPay;
	}

	@Column(name = "DATE")
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@ManyToOne
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne
	@JoinColumn(name = "MEMBER_ID")
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@ManyToOne
	@JoinColumn(name = "REPERTORY_ID")
	public Repertory getRepertory() {
		return repertory;
	}

	public void setRepertory(Repertory repertory) {
		this.repertory = repertory;
	}

	@Column(name = "TOTAL", length = 10, precision = 2)
	public Double getTotal() {
		return total;
	}

	public void setTotal(Double total) {
		this.total = total;
	}
	@Column(name = "POINT_NUM")
	public Integer getPointNum() {
		return pointNum;
	}

	public void setPointNum(Integer pointNum) {
		this.pointNum = pointNum;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@OneToMany(cascade = CascadeType.REMOVE, fetch = FetchType.LAZY, mappedBy = "salelist", orphanRemoval = true)
	public List<SalelistItem> getItems() {
		return items;
	}

	public void setItems(List<SalelistItem> items) {
		this.items = items;
	}

	@Column(name = "CHARGE")
	public Double getCharge() {
		return charge;
	}

	public void setCharge(Double charge) {
		this.charge = charge;
	}
	@Column(name = "WIPEZERO")
	public Double getWipeZero() {
		return wipeZero;
	}
	public void setWipeZero(Double wipeZero) {
		this.wipeZero = wipeZero;
	}
	
	

}